package eu.integration;

import java.util.ArrayList;
import java.util.List;

/**
 * 组件子网
 * @author WZZ
 *
 */
final class ModuleGroup implements NetNode{
	
	private List<NetNode> modules = new ArrayList<NetNode>();

	private Integer netId;
	
	@Override
	public final int getNetId() {
		return netId;
	}

	public final void setNetId(Integer netId) {
		this.netId = netId;
	}

	@Override
	public void send(Package pack) {
		for (NetNode node : modules) {
			node.send(pack);
		}
	}

	/**
	 * 群组不通知
	 */
	@Override
	public void notifyNetStart(IntegrationNet net) {
		
	}
	
	protected void addModule(NetNode node) {
		modules.add(node);
	}
	
}
